import { createRouter, createWebHistory } from 'vue-router'

const routes = [

    {
        path: "/index",
        name: "index",
        meta: {
            title: "首页"
        },
        component: () => import("../views/welcome.vue")
    },
    {
        path: "/cat",
        name: "cat",
        meta: {
            title: "CMS内容管理"
        },
        children: [
            {
                path: "/content-cat",
                name: "content-cat",
                meta: {
                    title: "内容类型管理"
                },
                component: () => import("../views/content-cat/index.vue")
            }, {
                path: "/content",
                name: "content",
                meta: {
                    title: "内容管理"
                },
                component: () => import("../views/content/index.vue")
            } 
        ]
    },
    {
        path: "/pro",
        name: "pro",
        meta: {
            title: "商品管理"
        },
        children: [
            {
                path: "/item-cat",
                name: "item-cat",
                meta: {
                    title: "商品类型管理"
                },
                component: ()=>import("../views/item-cat/index.vue")
            },
            {
                path: "/item-spe",
                name: "item-spe",
                meta: {
                    title: "商品规格管理"
                },
                component: ()=>import("../views/item-spe/index.vue")
            },
            {
                path: "/item",
                name: "item",
                meta: {
                    title: "商品管理"
                },
                component:()=>import("../views/item/index.vue")
            }
        ]
    }
];

const router = createRouter({
    history: createWebHistory(),
    routes
});


export default router;